Skip to content

Experimental support for pasting rich content into markdown input box#317604

Merged
lramos15 merged 3 commits into
mainfrom
lramos15/scornful-chameleon
May 21, 2026
Merged

Experimental support for pasting rich content into markdown input box#317604
lramos15 merged 3 commits into
mainfrom
lramos15/scornful-chameleon

Conversation

@lramos15
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings May 20, 2026 19:36
@lramos15 lramos15 self-assigned this May 20, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds experimental handling for pasting text/html into the chat markdown input by converting common HTML structures into Markdown, backed by a new lightweight converter utility and accompanying unit tests.

Changes:

  • Register a new chat paste provider that detects text/html clipboard data and converts it to Markdown on automatic paste.
  • Introduce convertHtmlToMarkdown in vs/base/common as a lightweight HTML→Markdown converter.
  • Add a focused unit test suite covering common conversion cases (headings, links, emphasis, code, lists, etc.).
Show a summary per file
File Description
src/vs/workbench/contrib/chat/browser/widget/input/editor/chatPasteProviders.ts Adds a PasteHtmlProvider that converts HTML clipboard content to Markdown for chat input pastes.
src/vs/base/common/htmlToMarkdown.ts Introduces a regex-based HTML→Markdown conversion utility used by the paste provider.
src/vs/base/test/common/htmlToMarkdown.test.ts Adds unit tests validating the converter’s behavior across common HTML constructs.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 3

Comment thread src/vs/base/common/htmlToMarkdown.ts Outdated
Comment thread src/vs/workbench/contrib/chat/browser/widget/input/editor/chatPasteProviders.ts Outdated
rzhao271
rzhao271 previously approved these changes May 20, 2026
@lramos15 lramos15 merged commit 337fa30 into main May 21, 2026
25 checks passed
@lramos15 lramos15 deleted the lramos15/scornful-chameleon branch May 21, 2026 13:17
@vs-code-engineering vs-code-engineering Bot added this to the 1.122.0 milestone May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants